home *** CD-ROM | disk | FTP | other *** search
- Path: prairienet.org!wemccaug
- From: wemccaug@prairienet.org (Wendy E. McCaughrin)
- Newsgroups: comp.lang.c++
- Subject: Re: HELP on abstraction!!!
- Date: 14 Apr 1996 00:56:30 GMT
- Organization: University of Illinois at Urbana
- Message-ID: <4kpifu$63j@vixen.cso.uiuc.edu>
- References: <316704f9.4805163@news> <4jok9c$a6e@merkurius.lu.se>
- Reply-To: wemccaug@prairienet.org (Wendy E. McCaughrin)
- NNTP-Posting-Host: firefly.prairienet.org
-
-
- In a previous article, Amir@bayarea.net (Amir) says:
-
- >On 1 Apr 1996 13:04:44 GMT, magnus_dahlberg@hermes.ics.lu.se (Magnus
- >Dahlberg) wrote:
- >
- >>Hello everyone!
- >>
- >>I'm writing a C++ programme that should be able to use both arrays and
- >>linked lists without changing the functions. Is it possible, for
- >>example, to insert a new person in my list (queue) without knowing if
- >>it's an array or a linked list? And if it is, how do I do it?
- >>
- This appears like a job for overloading of functions, so that, for
- example, one 'insert' for linked lists and another 'insert' for arrays.
- If the definitions of two functions were sufficiently similar in some
- cases, I would then suggest using templates (e.g., to count number of
- elements).
-